package com.miniapp.util;

import com.miniapp.entity.R;

import javax.servlet.ServletRequest;

/**
 * @author author
 * @date 2025-09-18 15:48
 */
public class WebFrameworkUtils {

    private static final String REQUEST_ATTRIBUTE_COMMON_RESULT = "common_result";

    public static void setCommonResult(ServletRequest request, R<?> result) {
        request.setAttribute(REQUEST_ATTRIBUTE_COMMON_RESULT, result);
    }

    public static R<?> getCommonResult(ServletRequest request) {
        return (R<?>) request.getAttribute(REQUEST_ATTRIBUTE_COMMON_RESULT);
    }

}
